package com.bondex.charter.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Arrays;
import java.util.List;

/**
 * 内部查询条件
 * Created by JD on 2021/9/14.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SearchParam {

	@Schema(description = "提单号。多个提单号用逗号或者别的来进行间隔")
	private String blNos;//提单号。多个提单号用逗号或者别的来进行间隔
	@Schema(description = "开船日期开始 yyyy-MM-dd 查询时大于等于此日期")
	private String etdBegin;//开船日期 yyyy-MM-dd
	@Schema(description = "开船日期结束 查询时小于此日期")
	private String etdEnd;//开船日期
	@Schema(description = "船名代码（不使用）")
	private String vesselNo;//船名代码
	@Schema(description = "船名。用户页面输入的完整信息，约定船名&航次之间使用英文半角空格相连接。")
	private String vessel;//船名
	@Schema(description = "航次（不使用）")
	private String voyage;//航次
	@Schema(description = "委托号。多个号用逗号或者别的来进行间隔")
	private String orderNos;//委托号。多个号用逗号或者别的来进行间隔
	@Schema(description = "客户订单号。多个号用逗号或者别的来进行间隔")
	private String customerNos;//客户订单号。多个号用逗号或者别的来进行间隔

	@Schema(description = "选择的状态列表。 " +
			"BOOKING_NEW:订舱待审核;BOOKING_PENDING:待定;BOOKING_RELEASE:已放舱;BOOKING_AMENDMENT:订舱更改;BOOKING_REJECTED:拒绝订舱;BOOKING_CANCEL:退舱;" +
			"SI_NEW:截单待确认;SI_CONFIRMED:已截单;SI_BL_AMENDMENT:截单更改;SI_AMS_FILING:AMS已申报;SI_BL_RELEASE:已签发;" +
			"SI_AMS_MATCHING_NOT:AMS未匹配;SI_AMS_MATCHING:AMS已匹配;" +
			"BOOKING_ROLL_OVER_NOT:未甩货;BOOKING_ROLL_OVER:甩货;" +
			"SI_AMENDMENT_FEE_CHARGING_NOT:未收费改单;SI_AMENDMENT_FEE:收费改单;" +
			"SI_SOC_NOT:未SOC;SI_SOC:SOC; ")
	private List<String> chooseStatus;//选择的状态列表
//	private String bookingStatus;//订舱状态。 0 订舱待审核； 2 待定； 1 已放舱； 3 已取消
//	private String siStatus;//截单状态。 0 截单待确认； 1 已截单
//	private Integer isBlAmendment;//改单。 0 未改单； 1 已改单
//	private Integer isAmsFiling;//AMS申报。 0 AMS未申报； 1 AMS已申报
//	private Integer isAmsMatching;//AMS匹配。 0 AMS未匹配； 1 AMS已匹配
//	private Integer isRollOver;//甩货。 0 未甩货； 1 甩货
//	private Integer isBlRelease;//提单签发。 0 未签发； 1 已签发

	@JsonIgnore
	private transient String blNoOne;
	@JsonIgnore
	private transient List<String> blNoList;
	@JsonIgnore
	private transient String orderNoOne;
	@JsonIgnore
	private transient List<String> orderNoList;
	@JsonIgnore
	private transient String customerNoOne;
	@JsonIgnore
	private transient List<String> customerNoList;
	@JsonIgnore
	private String split_flag=",";
	
	public String getBlNoOne() {
		return blNos;
	}

	public List<String> getBlNoList() {
		if(blNos!=null&&blNos.length()>0) {
			String[] strs=blNos.split(split_flag);
			if(strs!=null&&strs.length>1)
				return Arrays.asList(strs);
		}
		return null;
	}

	public String getOrderNoOne() {
		return orderNos;
	}

	public List<String> getOrderNoList() {
		if(orderNos!=null&&orderNos.length()>0) {
			String[] strs=orderNos.split(split_flag);
			if(strs!=null&&strs.length>1)
				return Arrays.asList(strs);
		}
		return null;
	}

	public String getCustomerNoOne() {
		return customerNos;
	}

	public List<String> getCustomerNoList() {
		if(customerNos!=null&&customerNos.length()>0) {
			String[] strs=customerNos.split(split_flag);
			if(strs!=null&&strs.length>1)
				return Arrays.asList(strs);
		}
		return null;
	}
	

	public String getBlNos() {
		return blNos;
	}

	public void setBlNos(String blNos) {
		this.blNos = blNos;
	}

	public String getEtdBegin() {
		return etdBegin;
	}

	public void setEtdBegin(String etdBegin) {
		this.etdBegin = etdBegin;
	}

	public String getEtdEnd() {
		return etdEnd;
	}

	public void setEtdEnd(String etdEnd) {
		this.etdEnd = etdEnd;
	}

	public String getVesselNo() {
		return vesselNo;
	}

	public void setVesselNo(String vesselNo) {
		this.vesselNo = vesselNo;
	}

	public String getVessel() {
		return vessel;
	}

	public void setVessel(String vessel) {
		this.vessel = vessel;
	}

	public String getVoyage() {
		return voyage;
	}

	public void setVoyage(String voyage) {
		this.voyage = voyage;
	}

	public String getOrderNos() {
		return orderNos;
	}

	public void setOrderNos(String orderNos) {
		this.orderNos = orderNos;
	}

	public String getCustomerNos() {
		return customerNos;
	}

	public void setCustomerNos(String customerNos) {
		this.customerNos = customerNos;
	}
	
	public List<String> getChooseStatus() {
		return chooseStatus;
	}

	public void setChooseStatus(List<String> chooseStatus) {
		this.chooseStatus = chooseStatus;
	}
}
